home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / hamlatin.inh < prev    next >
Text File  |  1993-08-23  |  3KB  |  121 lines

  1. inst4.1        !01-Jun-89  (hamming.ins) Hamming Network Builder
  2. !****************************************************************
  3. !*                                *
  4. !*    Hamming Network Generator                * 
  5. !*                                *
  6. !****************************************************************
  7.  
  8. !    *** check that input / output PE count is non-zero
  9.  
  10. ?&In    1
  11. >bge    CheckOut
  12. @Err    "Hamming Network MUST have at least one input PE"
  13. :CheckOut
  14. ?&Out    1
  15. >bge    OutOK
  16. @Err    "Hamming Network MUST have at least one output PE"
  17. :OutOK
  18.  
  19. !    *** Load the Control Strategy and LRS if needed
  20.  
  21. @LdCS    "hamming"        !control strategy
  22. @LdLR    "hamming"        !L/R schedule
  23.  
  24. =netn    "InstaNet (tm) Hamming Network version 2.00 01-Jun-89"
  25. =DLnF    0            !learn  re-display off
  26. =DRcF    0            !recall re-display off
  27.  
  28. !    *** Build the Input Layer ***
  29.  
  30. @LLdf                !load default layer to mi_layer structure
  31. =LDln    "In"            !layer name
  32. =Lpes    &In            !copy # of input PEs from menu
  33. =Ltrn    "Signum"        ! input -1's and 1's
  34. =x    100            !place to put layer on screen
  35. =y    60
  36. #Incl    "stdnwgtf.iif"        !standard # weight fields
  37. @LAdd                !add the input layer
  38.  
  39. !    *** Build the Category layer - use lateral inhibition ***
  40.  
  41. @LLdf                !start with default layer again
  42. =LDln    "Category"        !layer name
  43. =Lpes    &Out            !copy # of output PEs from menu
  44. =Ltrn    "Perceptron"        !for iterative inhibition
  45. =Llrn    "Widrow-Hoff"        !Widrow-Hoff - really Hebbian
  46. =LInL    0.0            !low initialization limit
  47. =LInH    0.0            !high initialization limit
  48. +y    100            !up higher on display
  49. #Incl    "stdnwgtf.iif"        !standard # weight fields
  50. @LAdd
  51.  
  52. !    *** Connect Category Layer to Input Layer and bias ***
  53.  
  54. =SPEl    LayN            !current layer
  55. @SlPE                !select it as destination
  56. =NPEl    0            !input layer
  57. @NrPE
  58. =cnwt    0.0            !connection weight
  59. =cnty    WVar            !variable weights
  60. =cnsc    WAbs            !absolute
  61. @LCFl                !fully connect to input layer
  62. =NPEl    -1            ! bias
  63. @NrPE
  64. =cnwt    &In            ! Start calculating bias weights
  65. /cnwt    2.0
  66. =cnty    WFix            !fixed weights
  67. @LCFl                !fully connect to bias
  68. =n0    LayN            !save current layer for later
  69.  
  70.  
  71. !    *** Connect Category Layer to itself (lateral inhibition) ***
  72.  
  73. =NPEl    LayN            !current layer
  74. @NrPE
  75. =cnwt    -0.99            ! Calculate
  76. /cnwt    &Out            ! inhibition weights
  77. =cnty    WSet            !Fixed weights
  78. @LCFl                !fully connect to itself
  79. =cnwt    1.0
  80. @LCCr                !Excitatory connections
  81.  
  82. !    *** Build the output layer ***
  83.  
  84. @LLdf                !start with default layer again
  85. =LDln    "Output"        !layer name
  86. =Lpes    &Out            !copy # of output PEs from menu
  87. =Ltrn    "StepFunction"        ! Output 0's and 1's
  88. =Llrn    "--None--"        !no learning
  89. +y    100            !up higher on display
  90. #Incl    "stdnwgtf.iif"        !standard # weight fields
  91. @LAdd
  92.  
  93. !    *** Connect Category layer to output layer ***
  94.  
  95. =SPEl    LayN            !current layer
  96. @SlPE                !select it as destination
  97. =NPEl    n0            !Category layer
  98. @NrPE
  99. =cnty    WFix            !fixed weights
  100. =cnwt    1.0            !connection weight
  101. @LCCr                !correspondingly connect
  102.  
  103. !    *** Select Control Strategy & L/R Schedule ***
  104.  
  105. @LLsl                !load super layer
  106. =Lctl    "hamming"        !control strategy
  107. =Llrs    "hamming"        !L/R Schedule
  108. =Llnn    "hamming"        !name of learn input
  109. =Lrcn    "hamming"        !name of recall output
  110. =Lscl    -1            !input  low-value
  111. =Loff     1            !input  high-value
  112. =Llow     0            !output low-value
  113. =Lhgh     1            !output high-value
  114. =Lax1    Epch            !epoch size
  115. @SVsl                !save it back
  116. !
  117. !=Grph     1
  118. !=GrLF    "hamlatin"            !instrument list file
  119. !
  120. @EOF
  121.